home *** CD-ROM | disk | FTP | other *** search
/ Champak Vol A-4 / (Vol A-4) Vol. A4.iso / Games / maquiagem-lana.swf / scripts / frame_4 / DoAction.as
Text File  |  2007-11-28  |  18KB  |  597 lines

  1. stop();
  2. var selected_tool = "foundation";
  3. var current_foundation = 2;
  4. var current_pencil = 0;
  5. var current_eye_shadow1 = 2;
  6. var current_eye_shadow2 = 2;
  7. var current_blusher = 2;
  8. var current_lip_stick = 2;
  9. var current_lip_gloss = 2;
  10. var current_mascara = 1;
  11. var current_eyelash_curler = 1;
  12. var current_eraser = 0;
  13. var a_makeup_tool = ["foundation","pencil","eye_shadow1","eye_shadow2","blusher","lip_stick","lip_gloss","mascara","eyelash_curler"];
  14. var i = 0;
  15. while(i < a_makeup_tool.length)
  16. {
  17.    _root[a_makeup_tool[i]].onRelease = function()
  18.    {
  19.       so1.start(0,1);
  20.       this.gotoAndStop(1);
  21.       selected_tool = this._name;
  22.       if(makeup_box_moving._currentframe == 1 || makeup_box_moving._currentframe == 12)
  23.       {
  24.          makeup_box_down();
  25.       }
  26.       else
  27.       {
  28.          makeup_box_moving.gotoAndPlay(8);
  29.       }
  30.    };
  31.    _root[a_makeup_tool[i]].onRollOver = function()
  32.    {
  33.       so1.start(0,1);
  34.       this.gotoAndPlay(2);
  35.    };
  36.    _root[a_makeup_tool[i]].onRollOut = function()
  37.    {
  38.       this.gotoAndStop(1);
  39.    };
  40.    _root[a_makeup_tool[i]].onReleaseOutside = function()
  41.    {
  42.       this.gotoAndStop(1);
  43.       selected_tool = this._name;
  44.       if(makeup_box_moving._currentframe == 1 || makeup_box_moving._currentframe == 12)
  45.       {
  46.          makeup_box_down();
  47.       }
  48.       else
  49.       {
  50.          makeup_box_moving.gotoAndPlay(8);
  51.       }
  52.    };
  53.    _root[a_makeup_tool[i]].onRollOver = function()
  54.    {
  55.       so1.start(0,1);
  56.       this.gotoAndPlay(2);
  57.    };
  58.    _root[a_makeup_tool[i]].onRollOut = function()
  59.    {
  60.       this.gotoAndStop(1);
  61.    };
  62.    i++;
  63. }
  64. makeup_clear_bt.onRollOver = function()
  65. {
  66.    so1.start(0,1);
  67.    this.makeup_clear_bt_rollover.gotoAndStop(2);
  68. };
  69. makeup_clear_bt.onRollOut = function()
  70. {
  71.    this.makeup_clear_bt_rollover.gotoAndStop(1);
  72. };
  73. makeup_clear_bt.onPress = function()
  74. {
  75.    this.gotoAndStop(2);
  76.    selected_tool = "eraser";
  77. };
  78. makeup_clear_bt.onRelease = function()
  79. {
  80.    so1.start(0,1);
  81.    this.gotoAndStop(1);
  82.    selected_tool = "eraser";
  83.    if(makeup_box_moving._currentframe == 1 || makeup_box_moving._currentframe == 12)
  84.    {
  85.       makeup_box_down();
  86.    }
  87.    else
  88.    {
  89.       makeup_box_moving.gotoAndPlay(8);
  90.    }
  91. };
  92. makeup_clear_bt.onReleaseOutside = function()
  93. {
  94.    this.gotoAndStop(1);
  95.    selected_tool = "eraser";
  96.    if(makeup_box_moving._currentframe == 1 || makeup_box_moving._currentframe == 12)
  97.    {
  98.       makeup_box_down();
  99.    }
  100.    else
  101.    {
  102.       makeup_box_moving.gotoAndPlay(8);
  103.    }
  104. };
  105. makeup_box_down = function()
  106. {
  107.    if(selected_tool == "foundation")
  108.    {
  109.       makeup_tool_m.gotoAndStop(1);
  110.       makeup_box_moving.makeup_box.gotoAndStop(1);
  111.       makeup_box_moving.makeup_box.makeup_color.gotoAndStop(4);
  112.       makeup_box_moving.gotoAndPlay(2);
  113.       current_foundation = 2;
  114.    }
  115.    else if(selected_tool == "pencil")
  116.    {
  117.       makeup_tool_m.gotoAndStop(2);
  118.       makeup_box_moving.makeup_box.gotoAndStop(3);
  119.       makeup_box_moving.gotoAndPlay(2);
  120.       make_eyebrow_move();
  121.    }
  122.    else if(selected_tool == "eye_shadow1")
  123.    {
  124.       makeup_tool_m.gotoAndStop(3);
  125.       makeup_box_moving.makeup_box.gotoAndStop(1);
  126.       makeup_box_moving.makeup_box.makeup_color.gotoAndStop(2);
  127.       makeup_box_moving.gotoAndPlay(2);
  128.       current_eye_shadow1 = 2;
  129.    }
  130.    else if(selected_tool == "eye_shadow2")
  131.    {
  132.       makeup_tool_m.gotoAndStop(4);
  133.       makeup_box_moving.makeup_box.gotoAndStop(1);
  134.       makeup_box_moving.makeup_box.makeup_color.gotoAndStop(2);
  135.       makeup_box_moving.gotoAndPlay(2);
  136.       current_eye_shadow2 = 2;
  137.    }
  138.    else if(selected_tool == "blusher")
  139.    {
  140.       makeup_tool_m.gotoAndStop(5);
  141.       makeup_box_moving.makeup_box.gotoAndStop(2);
  142.       makeup_box_moving.gotoAndPlay(2);
  143.       current_blusher = 2;
  144.    }
  145.    else if(selected_tool == "lip_stick")
  146.    {
  147.       makeup_tool_m.gotoAndStop(6);
  148.       makeup_box_moving.makeup_box.gotoAndStop(1);
  149.       makeup_box_moving.makeup_box.makeup_color.gotoAndStop(1);
  150.       makeup_box_moving.gotoAndPlay(2);
  151.       current_lip_stick = 2;
  152.    }
  153.    else if(selected_tool == "lip_gloss")
  154.    {
  155.       makeup_tool_m.gotoAndStop(7);
  156.       makeup_box_moving.makeup_box.gotoAndStop(1);
  157.       makeup_box_moving.makeup_box.makeup_color.gotoAndStop(3);
  158.       makeup_box_moving.gotoAndPlay(2);
  159.       current_lip_gloss = 2;
  160.    }
  161.    else if(selected_tool == "mascara")
  162.    {
  163.       makeup_tool_m.gotoAndStop(8);
  164.       eyelash_curler;
  165.    }
  166.    else if(selected_tool == "eyelash_curler")
  167.    {
  168.       makeup_tool_m.gotoAndStop(9);
  169.    }
  170.    else if(selected_tool == "eraser")
  171.    {
  172.       makeup_tool_m.gotoAndStop(10);
  173.       makeup_box_moving.makeup_box.gotoAndStop(4);
  174.       makeup_box_moving.gotoAndPlay(2);
  175.    }
  176.    make_pick_color();
  177. };
  178. makeup_tool_m.onEnterFrame = function()
  179. {
  180.    if(tool_hidden_area0.hitTest(_xmouse,_ymouse) || tool_hidden_area1.hitTest(_xmouse,_ymouse) || tool_hidden_area2.hitTest(_xmouse,_ymouse))
  181.    {
  182.       Mouse.show();
  183.       this._visible = false;
  184.    }
  185.    else
  186.    {
  187.       Mouse.hide();
  188.       this._visible = true;
  189.    }
  190.    if(makeup_box_moving.hitTest(_xmouse,_ymouse))
  191.    {
  192.       if(selected_tool != "foundation" && selected_tool != "mascara" && selected_tool != "eyelash_curler")
  193.       {
  194.          this._yscale = -100;
  195.       }
  196.       if(selected_tool == "pencil" || selected_tool == "eraser")
  197.       {
  198.          Mouse.show();
  199.          this._visible = false;
  200.       }
  201.    }
  202.    else
  203.    {
  204.       this._yscale = 100;
  205.    }
  206.    this._x = _root._xmouse;
  207.    this._y = _root._ymouse;
  208. };
  209. _root.onMouseDown = function()
  210. {
  211.    if(makeup_tool_m._visible)
  212.    {
  213.       if(!makeup_box_moving.hitTest(_xmouse,_ymouse))
  214.       {
  215.          so2.start(0,1);
  216.          makeup_tool_m.mov.gotoAndPlay(2);
  217.       }
  218.       if(makeup_box_moving.hitTest(_xmouse,_ymouse) && (makeup_box_moving._currentframe == 1 || makeup_box_moving._currentframe == 12))
  219.       {
  220.          so2.start(0,1);
  221.       }
  222.       if(selected_tool == "mascara" || selected_tool == "eyelash_curler")
  223.       {
  224.          makeup_tool_m.mov.gotoAndPlay(2);
  225.       }
  226.    }
  227.    if(ava_face.makeup_area.hitTest(_root._xmouse,_ymouse))
  228.    {
  229.       if(selected_tool == "pencil")
  230.       {
  231.          if(ava_face.face_eyebrow._currentframe != current_eyebrow + 1)
  232.          {
  233.             ava_face.face_eyebrow.gotoAndStop(current_eyebrow + 1);
  234.             ava_face.face_eyebrow._alpha = 0;
  235.          }
  236.          ava_face.face_eyebrow._alpha += 20;
  237.          if(Math.round(ava_face.face_eyebrow._alpha) > 100)
  238.          {
  239.             ava_face.face_eyebrow._alpha = 100;
  240.          }
  241.       }
  242.       if(selected_tool == "foundation")
  243.       {
  244.          if(ava_face.face_foundation._currentframe != current_foundation)
  245.          {
  246.             ava_face.face_foundation.gotoAndStop(current_foundation);
  247.             ava_face.face_foundation._alpha = 0;
  248.          }
  249.          ava_face.face_foundation._alpha += 20;
  250.          if(Math.round(ava_face.face_foundation._alpha) > 100)
  251.          {
  252.             ava_face.face_foundation._alpha = 100;
  253.          }
  254.       }
  255.       if(selected_tool == "eye_shadow1")
  256.       {
  257.          if(ava_face.face_eye_shadow1._currentframe != current_eye_shadow1)
  258.          {
  259.             ava_face.face_eye_shadow1.gotoAndStop(current_eye_shadow1);
  260.             ava_face.face_eye_shadow1._alpha = 0;
  261.          }
  262.          ava_face.face_eye_shadow1._alpha += 20;
  263.          if(Math.round(ava_face.face_eye_shadow1._alpha) > 100)
  264.          {
  265.             ava_face.face_eye_shadow1._alpha = 100;
  266.          }
  267.       }
  268.       if(selected_tool == "eye_shadow2")
  269.       {
  270.          if(ava_face.face_eye_shadow2._currentframe != current_eye_shadow2)
  271.          {
  272.             ava_face.face_eye_shadow2.gotoAndStop(current_eye_shadow2);
  273.             ava_face.face_eye_shadow2._alpha = 0;
  274.          }
  275.          ava_face.face_eye_shadow2._alpha += 20;
  276.          if(Math.round(ava_face.face_eye_shadow2._alpha) > 100)
  277.          {
  278.             ava_face.face_eye_shadow2._alpha = 100;
  279.          }
  280.       }
  281.       if(selected_tool == "blusher")
  282.       {
  283.          if(ava_face.face_cheek._currentframe != current_blusher)
  284.          {
  285.             ava_face.face_cheek.gotoAndStop(current_blusher);
  286.             ava_face.face_cheek._alpha = 0;
  287.          }
  288.          ava_face.face_cheek._alpha += 20;
  289.          if(Math.round(ava_face.face_cheek._alpha) > 100)
  290.          {
  291.             ava_face.face_cheek._alpha = 100;
  292.          }
  293.       }
  294.       if(selected_tool == "lip_stick")
  295.       {
  296.          ava_face.face_lip_gloss.gotoAndStop(1);
  297.          if(ava_face.face_lip._currentframe != current_lip_stick)
  298.          {
  299.             ava_face.face_lip.gotoAndStop(current_lip_stick);
  300.             ava_face.face_lip._alpha = 0;
  301.          }
  302.          ava_face.face_lip._alpha += 20;
  303.          if(Math.round(ava_face.face_lip._alpha) > 100)
  304.          {
  305.             ava_face.face_lip._alpha = 100;
  306.          }
  307.       }
  308.       if(selected_tool == "lip_gloss")
  309.       {
  310.          ava_face.face_lip.gotoAndStop(1);
  311.          if(ava_face.face_lip_gloss._currentframe != current_lip_gloss)
  312.          {
  313.             ava_face.face_lip_gloss.gotoAndStop(current_lip_gloss);
  314.             ava_face.face_lip_gloss._alpha = 0;
  315.          }
  316.          ava_face.face_lip_gloss._alpha += 20;
  317.          if(Math.round(ava_face.face_lip_gloss._alpha) > 100)
  318.          {
  319.             ava_face.face_lip_gloss._alpha = 100;
  320.          }
  321.       }
  322.       if(selected_tool == "mascara")
  323.       {
  324.          if(current_mascara < 6)
  325.          {
  326.             current_mascara++;
  327.          }
  328.          ava_face.face_curled_eyelashes.gotoAndStop(1);
  329.          ava_face.face_eyelashes.gotoAndStop(current_mascara);
  330.          current_eyelash_curler = 1;
  331.       }
  332.       if(selected_tool == "eyelash_curler")
  333.       {
  334.          ava_face.face_eyelashes.gotoAndStop(1);
  335.          ava_face.face_curled_eyelashes.gotoAndStop(current_mascara);
  336.       }
  337.       if(selected_tool == "eraser")
  338.       {
  339.          if(current_eraser == 2)
  340.          {
  341.             ava_face.face_foundation._alpha -= 20;
  342.             if(ava_face.face_foundation._alpha < 0)
  343.             {
  344.                ava_face.face_foundation._alpha = 0;
  345.             }
  346.          }
  347.          else if(current_eraser == 3)
  348.          {
  349.             if(ava_face.face_curled_eyelashes._currentframe != 1)
  350.             {
  351.                ava_face.face_eyelashes.gotoAndStop(ava_face.face_curled_eyelashes._currentframe);
  352.                ava_face.face_curled_eyelashes.gotoAndStop(1);
  353.             }
  354.             ava_face.face_eyelashes.prevFrame();
  355.             current_mascara = ava_face.face_eyelashes._currentframe;
  356.          }
  357.          else if(current_eraser == 4)
  358.          {
  359.             ava_face.face_eye_shadow2._alpha -= 20;
  360.             if(Math.round(ava_face.face_eye_shadow2._alpha) < 0)
  361.             {
  362.                ava_face.face_eye_shadow2._alpha = 0;
  363.             }
  364.          }
  365.          else if(current_eraser == 5)
  366.          {
  367.             ava_face.face_eye_shadow1._alpha -= 20;
  368.             if(Math.round(ava_face.face_eye_shadow1._alpha) < 0)
  369.             {
  370.                ava_face.face_eye_shadow1._alpha = 0;
  371.             }
  372.          }
  373.          else if(current_eraser == 6)
  374.          {
  375.             ava_face.face_cheek._alpha -= 20;
  376.             if(Math.round(ava_face.face_cheek._alpha) < 0)
  377.             {
  378.                ava_face.face_cheek._alpha = 0;
  379.             }
  380.          }
  381.          else if(current_eraser == 7)
  382.          {
  383.             if(ava_face.face_lip._currentframe != 1)
  384.             {
  385.                ava_face.face_lip._alpha -= 20;
  386.                if(Math.round(ava_face.face_lip._alpha) < 0)
  387.                {
  388.                   ava_face.face_lip._alpha = 0;
  389.                }
  390.             }
  391.             if(ava_face.face_lip_gloss._currentframe != 1)
  392.             {
  393.                ava_face.face_lip_gloss._alpha -= 20;
  394.                if(Math.round(ava_face.face_lip_gloss._alpha) < 0)
  395.                {
  396.                   ava_face.face_lip_gloss._alpha = 0;
  397.                }
  398.             }
  399.          }
  400.       }
  401.    }
  402. };
  403. make_pick_color = function()
  404. {
  405.    var _loc3_ = 0;
  406.    while(_loc3_ < 6)
  407.    {
  408.       makeup_box_moving.makeup_box["makeup_box_select_area" + _loc3_].onPress = function()
  409.       {
  410.          if(makeup_box_moving._currentframe != 1 && makeup_box_moving._currentframe != 12)
  411.          {
  412.             so1.start(0,1);
  413.          }
  414.          _root["current_" + selected_tool] = parseInt(this._name.slice(22,23)) + 2;
  415.          if(selected_tool == "foundation")
  416.          {
  417.             _root.makeup_tool_m.mov.chage_color.gotoAndStop(parseInt(this._name.slice(22,23)) + 1);
  418.          }
  419.          else
  420.          {
  421.             _root.makeup_tool_m.mov[selected_tool].change_color.gotoAndStop(parseInt(this._name.slice(22,23)) + 1);
  422.          }
  423.       };
  424.       _loc3_ = _loc3_ + 1;
  425.    }
  426. };
  427. var current_eyebrow = 0;
  428. make_eyebrow_move = function()
  429. {
  430.    current_eyebrow = 0;
  431.    var eye_move = false;
  432.    eye = makeup_box_moving.makeup_box.eyebrow_m;
  433.    var _loc2_ = 0;
  434.    while(_loc2_ < 6)
  435.    {
  436.       eye.eyebrow_win["eyebrow_" + _loc2_].removeMovieClip();
  437.       _loc2_ = _loc2_ + 1;
  438.    }
  439.    eye.eyebrow_win.setMask(eye.eyebrow_mask_m);
  440.    eye.eyebrow_win.attachMovie("eyebrow_0","eyebrow_0",0);
  441.    eye.eyebrow_m_rbt.onRollOver = function()
  442.    {
  443.       so1.start(0,1);
  444.       this._xscale = 110;
  445.       this._yscale = 110;
  446.    };
  447.    eye.eyebrow_m_rbt.onRollOut = function()
  448.    {
  449.       this._xscale = 100;
  450.       this._yscale = 100;
  451.    };
  452.    eye.eyebrow_m_rbt.onPress = function()
  453.    {
  454.       if(!eye_move)
  455.       {
  456.          so1.start(0,1);
  457.          this.gotoAndStop(2);
  458.          eye.eyebrow_win["eyebrow_" + current_eyebrow].onEnterFrame = function()
  459.          {
  460.             this._x += 12;
  461.             if(this._x > this._width)
  462.             {
  463.                this.removeMovieClip();
  464.                delete this.onEnterFrame;
  465.             }
  466.          };
  467.          current_eyebrow++;
  468.          if(current_eyebrow > 5)
  469.          {
  470.             current_eyebrow = 0;
  471.          }
  472.          eye.eyebrow_win.attachMovie("eyebrow_" + current_eyebrow,"eyebrow_" + current_eyebrow,current_eyebrow);
  473.          eye.eyebrow_win["eyebrow_" + current_eyebrow]._x = - eye.eyebrow_win["eyebrow_" + current_eyebrow]._width - 30;
  474.          eye.eyebrow_win["eyebrow_" + current_eyebrow].onEnterFrame = function()
  475.          {
  476.             eye_move = true;
  477.             this._x += 12;
  478.             if(this._x > 0)
  479.             {
  480.                this._x = 0;
  481.                eye_move = false;
  482.                delete this.onEnterFrame;
  483.             }
  484.          };
  485.       }
  486.    };
  487.    eye.eyebrow_m_rbt.onRelease = function()
  488.    {
  489.       this.gotoAndStop(1);
  490.    };
  491.    eye.eyebrow_m_rbt.onReleaseOutside = function()
  492.    {
  493.       this.gotoAndStop(1);
  494.    };
  495.    eye.eyebrow_m_lbt.onRollOver = function()
  496.    {
  497.       so1.start(0,1);
  498.       this._xscale = 110;
  499.       this._yscale = 110;
  500.    };
  501.    eye.eyebrow_m_lbt.onRollOut = function()
  502.    {
  503.       this._xscale = 100;
  504.       this._yscale = 100;
  505.    };
  506.    eye.eyebrow_m_lbt.onPress = function()
  507.    {
  508.       if(!eye_move)
  509.       {
  510.          so1.start(0,1);
  511.          this.gotoAndStop(2);
  512.          eye.eyebrow_win["eyebrow_" + current_eyebrow].onEnterFrame = function()
  513.          {
  514.             this._x -= 12;
  515.             if(this._x < - this._width)
  516.             {
  517.                this.removeMovieClip();
  518.                delete this.onEnterFrame;
  519.             }
  520.          };
  521.          current_eyebrow--;
  522.          if(current_eyebrow == -1)
  523.          {
  524.             current_eyebrow = 5;
  525.          }
  526.          eye.eyebrow_win.attachMovie("eyebrow_" + current_eyebrow,"eyebrow_" + current_eyebrow,current_eyebrow);
  527.          eye.eyebrow_win["eyebrow_" + current_eyebrow]._x = eye.eyebrow_win["eyebrow_" + current_eyebrow]._width + 30;
  528.          eye.eyebrow_win["eyebrow_" + current_eyebrow].onEnterFrame = function()
  529.          {
  530.             eye_move = true;
  531.             this._x -= 12;
  532.             if(this._x < 0)
  533.             {
  534.                this._x = 0;
  535.                eye_move = false;
  536.                delete this.onEnterFrame;
  537.             }
  538.          };
  539.       }
  540.    };
  541.    eye.eyebrow_m_lbt.onRelease = function()
  542.    {
  543.       this.gotoAndStop(1);
  544.    };
  545.    eye.eyebrow_m_lbt.onReleaseOutside = function()
  546.    {
  547.       this.gotoAndStop(1);
  548.    };
  549. };
  550. ending_go_bt.onRollOver = function()
  551. {
  552.    so1.start(0,1);
  553.    this.ending_go_bt_rollover.gotoAndStop(2);
  554. };
  555. ending_go_bt.onRollOut = function()
  556. {
  557.    this.ending_go_bt_rollover.gotoAndStop(1);
  558. };
  559. ending_go_bt.onPress = function()
  560. {
  561.    this.gotoAndStop(2);
  562. };
  563. ending_go_bt.onRelease = function()
  564. {
  565.    so1.start(0,1);
  566.    this.gotoAndStop(1);
  567.    save_face();
  568.    _root.gotoAndStop(5);
  569. };
  570. ending_go_bt.onReleaseOutside = function()
  571. {
  572.    this.gotoAndStop(1);
  573. };
  574. save_face = function()
  575. {
  576.    current_foundation_my_alpha = ava_face.face_foundation._alpha;
  577.    current_pencil_my_alpha = ava_face.face_eyebrow._alpha;
  578.    current_eye_shadow1_my_alpha = ava_face.face_eye_shadow1._alpha;
  579.    current_eye_shadow2_my_alpha = ava_face.face_eye_shadow2._alpha;
  580.    current_blusher_my_alpha = ava_face.face_cheek._alpha;
  581.    current_lip_stick_my_alpha = ava_face.face_lip._alpha;
  582.    current_lip_gloss_my_alpha = ava_face.face_lip_gloss._alpha;
  583.    current_foundation = ava_face.face_foundation._currentframe;
  584.    current_pencil = ava_face.face_eyebrow._currentframe;
  585.    current_eye_shadow1 = ava_face.face_eye_shadow1._currentframe;
  586.    current_eye_shadow2 = ava_face.face_eye_shadow2._currentframe;
  587.    current_blusher = ava_face.face_cheek._currentframe;
  588.    current_lip_stick = ava_face.face_lip._currentframe;
  589.    current_lip_gloss = ava_face.face_lip_gloss._currentframe;
  590.    current_mascara = ava_face.face_eyelashes._currentframe;
  591.    current_eyelash_curler = ava_face.face_curled_eyelashes._currentframe;
  592. };
  593. makeup_box_moving.gotoAndStop(7);
  594. makeup_box_moving.makeup_box.gotoAndStop(1);
  595. makeup_box_moving.makeup_box.makeup_color.gotoAndStop(4);
  596. make_pick_color();
  597.